<?php
/**
 * Created by PhpStorm.
 * User: zhangxilu
 * Date: 2018/1/29
 * Time: 下午10:01
 */

namespace frontend\modules\v1\controllers;


use common\models\ReportModel;
use frontend\common\ApiController;

class ReportController extends ApiController
{
    /**
     * 报备
     * @param     $contacts
     * @param     $phone
     * @param     $status
     * @param int $referee
     *
     * @return \yii\web\Response
     */
    public function actionAdd($contacts,$phone,$status,$referee,$uid,$house_id){
        $report = new ReportModel();
        $report->contacts = $contacts;
        $report->phone = $phone;
        $report->status = $status;
        $report->referee = $referee;
        $report->uid=$uid;
        $report->house_id = $house_id;
        $report->create_time=time();
        if($report->save()){
            return $this->success(['report' => $report->toArray()]);
        }
        return $this->error('报备失败');
    }
}